package edu.nf.relaxenjoy.web.initserver;

import edu.nf.relaxenjoy.common.util.RedisUtils;
import edu.nf.relaxenjoy.service.PostService;
import edu.nf.relaxenjoy.service.UserService;
import lombok.RequiredArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

/**
 * @author zhu
 * @date 2024-12-24
 */
@Component
@RequiredArgsConstructor
public class PlatformInitServer implements ApplicationRunner {

    private static Logger logger = LoggerFactory.getLogger(PlatformInitServer.class);

    private final PostService postService;

    private final UserService userService;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        postService.addBulkData();
        postService.addBulkRedisData();
        userService.addBulkUserRecord();
    }
}
